<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="12" :sm="16">
            <a-form-item label="采集时间">
              <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始日期" class="query-group-cust" v-model="queryParam.acqTime_begin"></j-date>
              <span class="query-group-split-cust"></span>
              <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束日期" class="query-group-cust" v-model="queryParam.acqTime_end"></j-date>
            </a-form-item>
          </a-col>
          <!--<a-col :md="12" :sm="16">
            <a-form-item label="温度">
              <a-input placeholder="请输入最小值" class="query-group-cust" v-model="queryParam.smtWd_begin"></a-input>
              <span class="query-group-split-cust"></span>
              <a-input placeholder="请输入最大值" class="query-group-cust" v-model="queryParam.smtWd_end"></a-input>
            </a-form-item>
          </a-col>-->
          <a-col :md="6" :sm="8" >
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
              <a @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
              </a>
            </span>
          </a-col>

        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->
    
    <!-- 操作按钮区域 -->

    <!-- table区域-begin -->
    <div>

      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey=""
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange">
        <span slot="action" slot-scope="text, record">
          <a @click="handleDetail(record)">查看</a>
        </span>
      </a-table>
    </div>

    <zxjEip-2chjwsd-modal ref="modalForm"></zxjEip-2chjwsd-modal>
  </a-card>
</template>

<script>

  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import ZxjEip2chjwsdModal from './modules/ZxjEip2chjwsdModal'
  import JDate from '@/components/jeecg/JDate.vue'
  import { getAction } from '@/api/manage'

  export default {
    name: "ZxjEip2chjwsdList",
    mixins:[JeecgListMixin],
    components: {
      JDate,
      ZxjEip2chjwsdModal
    },
    data () {
      return {
        description: '环境温湿度管理页面',
        // 表头
        columns: [
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
          },
          {
            title:'供应商',
            align:"center",
            dataIndex: 'supplierName'
          },
          {
            title:'采集时间',
            align:"center",
            dataIndex: 'acqTime',
            /*customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }*/
          },
          {
            title:'原材料库房',
            align:"center",
            dataIndex: 'rawMatPlace'
          },
          {
            title:'工厂',
            align:"center",
            dataIndex: 'factory'
          },
          {
            title:'抓取状态',
            align:"center",
            dataIndex: 'ioflag',
            customRender:function (text) {
              return !text?"":(text == 0?'已抓取':'未抓取')
            }
          },
          {
            title:'抓取日期',
            align:"center",
            dataIndex: 'updateTime',
            /*customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }*/
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            scopedSlots: { customRender: 'action' },
          }
        ],
        url: {
          list: "/apis/zxjEip2cHjwsd/list",
        },
        dictOptions:{
        } 
      }
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      }
    },
    methods: {
      initDictConfig(){
      },
      handleDetail(record){
        this.$refs.modalForm.addModal(record);
        this.$refs.modalForm.title="详细信息";
      }
    }
  }
</script>